0 CpxTRS
↳1 NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxTRS
↳3 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxWeightedTrs
↳5 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳6 CpxTypedWeightedTrs
↳7 CompletionProof (UPPER BOUND(ID), 0 ms)
↳8 CpxTypedWeightedCompleteTrs
↳9 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 2 ms)
↳10 CpxRNTS
↳11 CompleteCoflocoProof (⇔, 94 ms)
↳12 BOUNDS(1, 1)
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y))
g(b) → c
b → c
g(X) → n__g(X)
activate(n__g(X)) → g(X)
activate(X) → X
g(X) → n__g(X)
b → c
activate(X) → X
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y))
activate(n__g(X)) → g(X)
g(X) → n__g(X) [1]
b → c [1]
activate(X) → X [1]
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y)) [1]
activate(n__g(X)) → g(X) [1]
g(X) → n__g(X) [1]
b → c [1]
activate(X) → X [1]
f(X, n__g(X), Y) → f(activate(Y), activate(Y), activate(Y)) [1]
activate(n__g(X)) → g(X) [1]
g :: n__g → n__g n__g :: n__g → n__g b :: c c :: c activate :: n__g → n__g f :: n__g → n__g → n__g → f |
f(v0, v1, v2) → null_f [0]
null_f, const
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
c => 0
null_f => 0
const => 0
activate(z) -{ 1 }→ X :|: X >= 0, z = X
activate(z) -{ 1 }→ g(X) :|: z = 1 + X, X >= 0
b -{ 1 }→ 0 :|:
f(z, z', z'') -{ 1 }→ f(activate(Y), activate(Y), activate(Y)) :|: Y >= 0, z'' = Y, z' = 1 + X, X >= 0, z = X
f(z, z', z'') -{ 0 }→ 0 :|: v0 >= 0, z'' = v2, v1 >= 0, z = v0, z' = v1, v2 >= 0
g(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
eq(start(V, V1, V2),0,[g(V, Out)],[V >= 0]). eq(start(V, V1, V2),0,[b(Out)],[]). eq(start(V, V1, V2),0,[activate(V, Out)],[V >= 0]). eq(start(V, V1, V2),0,[f(V, V1, V2, Out)],[V >= 0,V1 >= 0,V2 >= 0]). eq(g(V, Out),1,[],[Out = 1 + X1,X1 >= 0,V = X1]). eq(b(Out),1,[],[Out = 0]). eq(activate(V, Out),1,[],[Out = X2,X2 >= 0,V = X2]). eq(f(V, V1, V2, Out),1,[activate(Y1, Ret0),activate(Y1, Ret1),activate(Y1, Ret2),f(Ret0, Ret1, Ret2, Ret)],[Out = Ret,Y1 >= 0,V2 = Y1,V1 = 1 + X3,X3 >= 0,V = X3]). eq(activate(V, Out),1,[g(X4, Ret3)],[Out = Ret3,V = 1 + X4,X4 >= 0]). eq(f(V, V1, V2, Out),0,[],[Out = 0,V3 >= 0,V2 = V4,V5 >= 0,V = V3,V1 = V5,V4 >= 0]). input_output_vars(g(V,Out),[V],[Out]). input_output_vars(b(Out),[],[Out]). input_output_vars(activate(V,Out),[V],[Out]). input_output_vars(f(V,V1,V2,Out),[V,V1,V2],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. non_recursive : [g/2]
1. non_recursive : [activate/2]
2. non_recursive : [b/1]
3. recursive : [f/4]
4. non_recursive : [start/3]
#### Obtained direct recursion through partial evaluation
0. SCC is completely evaluated into other SCCs
1. SCC is partially evaluated into activate/2
2. SCC is completely evaluated into other SCCs
3. SCC is partially evaluated into f/4
4. SCC is partially evaluated into start/3
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations activate/2
* CE 5 is refined into CE [9]
* CE 6 is refined into CE [10]
### Cost equations --> "Loop" of activate/2
* CEs [9,10] --> Loop 5
### Ranking functions of CR activate(V,Out)
#### Partial ranking functions of CR activate(V,Out)
### Specialization of cost equations f/4
* CE 8 is refined into CE [11]
* CE 7 is refined into CE [12]
### Cost equations --> "Loop" of f/4
* CEs [12] --> Loop 6
* CEs [11] --> Loop 7
### Ranking functions of CR f(V,V1,V2,Out)
#### Partial ranking functions of CR f(V,V1,V2,Out)
### Specialization of cost equations start/3
* CE 2 is refined into CE [13]
* CE 3 is refined into CE [14]
* CE 4 is refined into CE [15]
### Cost equations --> "Loop" of start/3
* CEs [13,14,15] --> Loop 8
### Ranking functions of CR start(V,V1,V2)
#### Partial ranking functions of CR start(V,V1,V2)
Computing Bounds
=====================================
#### Cost of chains of activate(V,Out):
* Chain [5]: 2
with precondition: [V=Out,V>=0]
#### Cost of chains of f(V,V1,V2,Out):
* Chain [7]: 0
with precondition: [Out=0,V>=0,V1>=0,V2>=0]
* Chain [6,7]: 7
with precondition: [Out=0,V1=V+1,V1>=1,V2>=0]
#### Cost of chains of start(V,V1,V2):
* Chain [8]: 7
with precondition: []
Closed-form bounds of start(V,V1,V2):
-------------------------------------
* Chain [8] with precondition: []
- Upper bound: 7
- Complexity: constant
### Maximum cost of start(V,V1,V2): 7
Asymptotic class: constant
* Total analysis performed in 51 ms.